    import { mapState, createNamespacedHelpers } from "vuex"
    import useMapper from "./useMapper"

    //支持模块化的写法
    export default function (name, states) {

        let mapFn = mapState
        if(typeof name === 'string' && name.length > 0 ) {
            mapFn = createNamespacedHelpers(name).mapState
        }
        return useMapper(states, mapFn)
    }
